﻿using System.IO.IsolatedStorage;
using FreshMeat.Storage;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Storage.More.Test
{
   [TestClass]
   public class IsoFileStoreTest : CommonStoreTest
   {
      protected override IStore<int, Data> CreateStore()
      {
         var folder = System.IO.Path.GetRandomFileName();
         var area = IsolatedStorageFile.GetUserStoreForAssembly();
         var fileSystem = new IsolatedStorageFileSystem(area, folder);
         var fileLocator = new FileLocator<int>(fileSystem, false, ".test", int.Parse);

         var store = new FileStore<int, Data>(fileLocator, new JsonSerializer<Data>());
         return store;
      }

      // ReSharper disable MemberCanBePrivate.Global
      // ReSharper disable UnusedAutoPropertyAccessor.Global
      public TestContext TestContext { get; set; }
      // ReSharper restore UnusedAutoPropertyAccessor.Global
      // ReSharper restore MemberCanBePrivate.Global
   }
}